try:
    text = input('Enter something -->')
except EOFError:
    #在windows下结束符是按ctrl-z,unix系统下按ctrl-d
    print('Why did you do an EOF on me?')
except KeyboardInterrupt:
    # 键盘中断按ctrl-c
    print('You cancelled the operation.')
else:
    print('You entered "{}"'.format(text))